<?php
//Compiled by TIBlog Template Engine v2.0 , Created on : 2011-04-24 15:05:58
defined('IN_DTE') or exit('Access Denied');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<TITLE><?php
echo $_obj['title'];
?>
 短评</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<meta name="keywords" content="<?php
echo $_obj['title'];
?>
,<?php
echo $_obj['title'];
?>
,短评,评论,观后感"/>
<meta name="description" content="<?php
echo $_obj['title'];
?>
短评" />
<LINK rel=stylesheet type=text/css href="/static/css/global.css">
<LINK rel=stylesheet type=text/css href="/static/css/packed_douban53.css">
<LINK rel=stylesheet type=text/css href="/static/css/packed__all12.css">
<script type="text/javascript" src="/static/js/jquery.min4.js"></script>
<script type="text/javascript" src="/static/js/rating.js"></script>
<script type="text/javascript" src="/static/js/dialog.js"></script>
</head>
<body>
<div id=header>
	<div class="topbar">
		<div class="l"></div>
	  <div class="r"><?php
echo $_obj['logintip'];
?>
</div>		
		
	</div>
	<div class=topper>
		<div class=logo>
			<p><a href="/">电影评论网</a><span>beta</span></p>
			</br>
			<p>movie.com</p>
			<p>最新、最热、最实时的电影信息和评论</p> 
		</div>
		<div class=nav>
			<ul>
				<li><a href="/movie/coming">即将上映</a>  |</li>
				<li><a href="/movie/hot">最热</a>  |</li>
				<li><a href="/movie/popular">最多喜欢</a></li>
			</ul> 
		</div>
	</div>
	<div class=searchbar>
		<form method="get" action="/search/">
			<input type="text" class="ipt" name="keywords" value="电影名称、导演或演员" onblur="if(this.value=='') this.value='电影名称、导演或演员';" 
		onfocus="if(this.value=='电影名称、导演或演员') this.value='';" /><input type="submit" class="sbtn" value="" />
		</form>
	</div>
</div>
<div id="content">
<h1><?php
echo $_obj['title'];
?>
 短评</h1>
<div class="grid-16-8 clearfix">
	<div class="article">
	<span><?php
echo $_obj['mtips'];
?>
</span>
	<div>
<script type="text/javascript">
$(function() {
	//$.fn.raty.readOnly(true);
	$('#rating').raty({
		//readOnly:true,
		//noRatedMsg: '尚未有人评价!',
		half: true,
		click: function(score) {
			document.getElementById("comment").value = '我给电影《<?php
echo $_obj['title'];
?>
》评分是:' + score * 2 + '分。';
		}
		//start:3.5,
	});
});

function voteComment(cid){
	votes = $.ajax({url:"/movie/comments/vote/" + cid,async:false});
	result = votes.responseText;
	if (result == 'ok'){
		val = parseInt($("#vote_"+cid)[0].value);
		$("#vote_val_"+cid).html(val + 1);
	}else{
		$.fn.jmodal({title: '短评投票',content: '<BR>'+result+'<BR><BR>'});	
		window.setTimeout($.fn.hideJmodal,700);
	}
}

function checkNum (){
	var text1 = document.getElementById("comment").value;
	if(text1 == '请选择星星给电影评分'){
		document.getElementById("comment").value = '';
	}
	if(text1 == ''){
		document.getElementById("comment").value = '请选择星星给电影评分';
	}
	var len;
	var olen = 140;
	if(text1.length >= olen){
		$("#countTxt").html('<span style="color:red">0</span>');
		document.getElementById("comment").value = text1.substr(0,olen);		
	}else{ 
		$("#countTxt").html('<span style="color:green">'+(olen - text1.length)+'</span>');
	}	   
}

function watchAction (id){ 
	if(id == '2'){
		document.getElementById("comment").value = '我想看电影《<?php
echo $_obj['title'];
?>
》。';
		$("#collectBox").hide('fast');
	}else{
		document.getElementById("comment").value = '请选择星星给电影评分。';
		$("#collectBox").show('fast');
	}
}
</script>

	<form name="comments" method="post" action="/movie/comments/new/<?php
echo $_obj['id'];
?>
">
	<div id="collectBox">我看了，我的评分是：<span id="rating"></span></div>
	<div style="margin-top:10px">
		<div style="float:left;width:100px">
			<label><input type="radio" name="watch_action" value="1" checked="checked" onclick="watchAction('1');"/>看了</label>         
			<label><input type="radio" name="watch_action" value="2" onclick="watchAction('2');"/>想看</label>
		</div>
		<div style="float:left;;width:485px;text-align:right">
			<textarea class="textarea" name="content" id="comment" style="width:460px;height:75px;margin:0px" onKeyUp="checkNum()" onblur="checkNum()" onfocus="checkNum()" >请选择星星给电影评分</textarea>
			<label style="color:#999;">还能输入 <span id="countTxt" style="font-size:18px;color:green" >140</span> 个字</label>
			<input type="submit" class="btn" value="写短评"/>
		</div>
	</div>
	</form>
	</div>
	<div class="clear"></div>


		<div class="title_line clearfix color_gray">
			<span class="fleft">共<?php
echo $_obj['total'];
?>
条</span>
			<span class="fright">按投票排序&nbsp;</span>
		</div>

		<ul class="simple_list" id='all_comment'>
			<?php
if (!empty($_obj['commentList'])){
if (!is_array($_obj['commentList']))
$_obj['commentList']=array(array('commentList'=>$_obj['commentList']));
$_tmp_arr_keys=array_keys($_obj['commentList']);
if ($_tmp_arr_keys[0]!='0')
$_obj['commentList']=array(0=>$_obj['commentList']);
$_stack[$_stack_cnt++]=$_obj;
foreach ($_obj['commentList'] as $rowcnt=>$commentList) {
$commentList['ROWCNT']=$rowcnt;
$commentList['ALTROW']=$rowcnt%2;
$commentList['ROWBIT']=$rowcnt%2;
$_obj=&$commentList;
?>
			<li class="clearfix">
				<div class="userface"><a href="/people/<?php
echo $_obj['uid'];
?>
/"><img src="/static/avatars/<?php
echo $_obj['avatars'];
?>
" /></a></div>
				<div class="comment">
					<h3 class="clearfix color_gray">
					<input id="vote_<?php
echo $_obj['id'];
?>
" value="<?php
echo $_obj['support'];
?>
" type="hidden"/>
						<span class="fright">
						<span class="votes pr5" id="vote_val_<?php
echo $_obj['id'];
?>
"><?php
echo $_obj['support'];
?>
</span><a href="javascript:;" onclick="voteComment(<?php
echo $_obj['id'];
?>
);">有用</a></span>
						<span class="fleft"><a href="/people/<?php
echo $_obj['uid'];
?>
/"><?php
echo $_obj['username'];
?>
</a></span>
						<span class="fleft ml8"><?php
echo $_obj['addtime'];
?>
</span>
						<span class="stars<?php
echo $_obj['rating'];
?>
 stars"></span>
					</h3>
					<p class="w490"><?php
echo $_obj['contents'];
?>
</p>
				</div>
			</li>
			<?php
}
$_obj=$_stack[--$_stack_cnt];}
?> 
		</ul>
		<?php
echo $_obj['pages'];
?>

		<span class="count">(共<?php
echo $_obj['total'];
?>
条)</span>
	</div>

	<div class="aside">
		<p class="pl2">&gt; <a href="/movie/<?php
echo $_obj['id'];
?>
/">去<?php
echo $_obj['title'];
?>
的页面</a></p>
		<?php
echo $_obj['descs'];
?>

	</div>
</div>

<DIV class=clear></DIV>
<DIV id="footer">
	<DIV class="left">
		&copy; 2010 Movie.com, All Rights Reserved.&nbsp;&nbsp;&nbsp;苏ICP没有备案号&nbsp;&nbsp;<BR>
		<SPAN><?php
echo $_obj['debuginfo'];
?>
</SPAN>
	</DIV>
	<DIV class="right">
		<A href="/about/aboutus">关于我们</A>
		<A href="/about/flinks">友情链接</A>
		<A href="/about/contact">联系及合作</A>
		<A href="/about/feedback">投诉与建议</A>
		<A href="/about/sitemap">站点地图</A>
		<A href="/about/sitemap">使用帮助</A>		 
	</DIV>
</DIV>       
</body></html>